/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.proteu.hibernate.beans;

import br.com.proteu.hibernate.util.FireBirdHelperProteu;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.Transient;

/**
 *
 * @author ricardo
 */
@Entity
@Table(name="AGENDAMENTOMEDICO")
public class AgendamentoMedicoProteu implements Serializable{

    @Id
    @Column(name="AGM_ST_CODIGO")
    private String agmStCodigo;
    @Column(name="AGD_ST_CODIGO")
    private String agdStCodigo;
    @Column(name="MED_ST_CODIGO")
    private String medStCodigo;
    @Column(name="MED_ST_NOME")
    private String medStNome;
    @Column(name="PROC_ST_COD_AMB")
    private String procStCodAmb;
    @Column(name="AGM_ST_TIPO_SERVICO")
    private String agmStTipoServico;
    @Column(name="CON_ST_CODIGO")
    private String conStCodigo;
    @Column(name="CON_ST_PLA_CODIGO")
    private String conStPlaCodigo;
    @Column(name="PAC_ST_RG")
    private String pacStRg;
    @Column(name="PAC_ST_NOME")
    private String pacStNome;
    @Column(name="AGD_CH_PRESENCA")
    private String agdChPresenca;
    @Column(name="AGD_DT_CONSULTA")
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date agdDtConsulta;
    @Column(name="AGD_ST_HORA_CONSULTA")
    private String agdStHoraConsulta;
    @Column(name="AGD_CH_ATENDIDO")
    private String agdChAtendido;
    @Column(name="AGM_DT_ATENDIMENTO")
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date agmDtAtendimento;
    @Column(name="AGM_HR_ATENDIMENTO")
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date agmHrAtendimento;//timestamp
    @Column(name="AGM_ST_QT")
    private String agmStQt;
    @Column(name="AGM_CH_EXAME_IMPRESSO")
    private String agmChExameImpresso;
    @Column(name="AGM_ST_USUARIO_IMPRIMIU")
    private String agmStUsuarioImprimiu;



    @Transient
    private PacienteProteu pacienteObject;
    @Transient
    private AgendamentoProteu agendamentoProteuObject;


    


    public String getAgdChAtendido() {
        return agdChAtendido;
    }

    public void setAgdChAtendido(String agdChAtendido) {
        this.agdChAtendido = agdChAtendido;
    }

    public String getAgdChPresenca() {
        return agdChPresenca;
    }

    public void setAgdChPresenca(String agdChPresenca) {
        this.agdChPresenca = agdChPresenca;
    }

    public Date getAgdDtConsulta() {
        return agdDtConsulta;
    }

    public void setAgdDtConsulta(Date agdDtConsulta) {
        this.agdDtConsulta = agdDtConsulta;
    }

    public String getAgdStCodigo() {
        return agdStCodigo;
    }

    public void setAgdStCodigo(String agdStCodigo) {
        this.agdStCodigo = agdStCodigo;
    }

    public String getAgdStHoraConsulta() {
        return agdStHoraConsulta;
    }

    public void setAgdStHoraConsulta(String agdStHoraConsulta) {
        this.agdStHoraConsulta = agdStHoraConsulta;
    }

    public String getAgmChExameImpresso() {
        return agmChExameImpresso;
    }

    public void setAgmChExameImpresso(String agmChExameImpresso) {
        this.agmChExameImpresso = agmChExameImpresso;
    }

    public Date getAgmDtAtendimento() {
        return agmDtAtendimento;
    }

    public void setAgmDtAtendimento(Date agmDtAtendimento) {
        this.agmDtAtendimento = agmDtAtendimento;
    }

    public Date getAgmHrAtendimento() {
        return agmHrAtendimento;
    }

    public void setAgmHrAtendimento(Date agmHrAtendimento) {
        this.agmHrAtendimento = agmHrAtendimento;
    }

    public String getAgmStCodigo() {
        return agmStCodigo;
    }

    public void setAgmStCodigo(String agmStCodigo) {
        this.agmStCodigo = agmStCodigo;
    }

    public String getAgmStQt() {
        return agmStQt;
    }

    public void setAgmStQt(String agmStQt) {
        this.agmStQt = agmStQt;
    }

    public String getAgmStTipoServico() {
        return agmStTipoServico;
    }

    public void setAgmStTipoServico(String agmStTipoServico) {
        this.agmStTipoServico = agmStTipoServico;
    }

    public String getAgmStUsuarioImprimiu() {
        return agmStUsuarioImprimiu;
    }

    public void setAgmStUsuarioImprimiu(String agmStUsuarioImprimiu) {
        this.agmStUsuarioImprimiu = agmStUsuarioImprimiu;
    }

    public String getConStCodigo() {
        return conStCodigo;
    }

    public void setConStCodigo(String conStCodigo) {
        this.conStCodigo = conStCodigo;
    }

    public String getConStPlaCodigo() {
        return conStPlaCodigo;
    }

    public void setConStPlaCodigo(String conStPlaCodigo) {
        this.conStPlaCodigo = conStPlaCodigo;
    }

    public String getMedStCodigo() {
        return medStCodigo;
    }

    public void setMedStCodigo(String medStCodigo) {
        this.medStCodigo = medStCodigo;
    }

    public String getMedStNome() {
        return medStNome;
    }

    public void setMedStNome(String medStNome) {
        this.medStNome = medStNome;
    }

    public String getPacStNome() {
        return pacStNome;
    }

    public void setPacStNome(String pacStNome) {
        this.pacStNome = pacStNome;
    }

    public String getPacStRg() {
        return pacStRg;
    }

    public void setPacStRg(String pacStRg) {
        this.pacStRg = pacStRg;
    }

    public String getProcStCodAmb() {
        return procStCodAmb;
    }

    public void setProcStCodAmb(String procStCodAmb) {
        this.procStCodAmb = procStCodAmb;
    }

    @Transient
    public PacienteProteu getPacienteObject() {
        if(pacienteObject == null && this.pacStNome != null){
            this.pacienteObject = (PacienteProteu) FireBirdHelperProteu.getPacienteByRGandNome(this.pacStRg,this.pacStNome);
        }

        return pacienteObject;
    }

    public void setPacienteObject(PacienteProteu pacienteObject) {
        this.pacienteObject = pacienteObject;
    }

    @Transient
    public AgendamentoProteu getAgendamentoProteuObject() {
        if(agendamentoProteuObject == null && this.agdStCodigo != null){
            this.agendamentoProteuObject = (AgendamentoProteu) FireBirdHelperProteu.getObject(AgendamentoProteu.class, this.agdStCodigo);
        }

        return agendamentoProteuObject;
    }

    public void setAgendamentoProteuObject(AgendamentoProteu agendamentoProteuObject) {
        this.agendamentoProteuObject = agendamentoProteuObject;
    }




    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AgendamentoMedicoProteu other = (AgendamentoMedicoProteu) obj;
        if ((this.agmStCodigo == null) ? (other.agmStCodigo != null) : !this.agmStCodigo.equals(other.agmStCodigo)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + (this.agmStCodigo != null ? this.agmStCodigo.hashCode() : 0);
        return hash;
    }


}
